<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>课程页面</title>
</head>
<body>
    <input type="button" value="新增" id="add"><br>
    <hr>
    <table border="1" cellspacing="2" width="800" bgcolor="#ff7f50">
        <tr>
            <th>序号</th>
            <th>课程名</th>
            <th>课程学时</th>
            <th>操作</th>
        </tr>
        <%--varStatus:标识状态，id一般不写，自动动态的生成,status(index,count)--%>
        <c:forEach items="${courseList}" var="course">
            <tr align="center">
                <td>${course.courseId}</td>
                <td>${course.courseName}</td>
                <td>${course.courseTime}</td>
                <td><a href="/course/getById?courseId=${course.courseId}">修改
                </a> <a href="/course/deleteById?courseId=${course.courseId}">删除</a>
                 <a href="/studentcourse/getInfoByCourseId?courseId=${course.courseId}">选课</a>
                </td>
            </tr>
        </c:forEach>
    </table>
    <hr>
    <input type="button" value="回到首页" id="index">
<script>
    //单击新增按钮之后进行页面跳转
    document.getElementById("add").onclick=function () {
        location.href="/addCourse.jsp";
    }
    //单击回到首页按钮之后进行页面跳转
    document.getElementById("index").onclick=function () {
        location.href="/student/getAll";
    }
</script>
</body>
</html>
